#ifndef VIDEO_CAPTURE_H
#define VIDEO_CAPTURE_H

// vcm_capturer_test.h
#include "easylog.h"

#include <memory>
#include <QObject>
#include "modules/video_capture/video_capture.h"
#include "video_capturer_test.h"

class VcmCapturerTest : public QObject,
                        public VideoCapturerTest,
                        public rtc::VideoSinkInterface<webrtc::VideoFrame>

{
    Q_OBJECT

public:
    VcmCapturerTest();

    static VcmCapturerTest* Create(size_t width,
                                 size_t height,
                                 size_t target_fps,
                                 size_t capture_device_index);

    virtual ~VcmCapturerTest();

    void OnFrame(const webrtc::VideoFrame& frame) override;
signals:
    void UpdateFrame(rtc::scoped_refptr<webrtc::I420BufferInterface>& buffer);
    void UpdateFrame1(uint8_t *dat);
private:

    bool Init(size_t width,
            size_t height,
            size_t target_fps,
            size_t capture_device_index);

    void Destroy();

    rtc::scoped_refptr<webrtc::VideoCaptureModule> vcm_;
    webrtc::VideoCaptureCapability capability_;
};



#endif // VIDEO_CAPTURE_H
